package com.device.service.impl;

import java.util.List;
import java.util.ArrayList;
import com.device.util.Page;
import javax.annotation.Resource;
import com.device.vo.AlarmConfigVo;
import com.device.entity.AlarmConfig;
import com.device.mapper.AlarmConfigMapper;
import com.device.service.AlarmConfigService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lgb
 * @date 2020-10-15
 * @return 告警配置服务
 **/
@Service
public class AlarmConfigServiceImpl implements AlarmConfigService{

	@Resource
	private AlarmConfigMapper acMapper;
	
	/**
	 * @date 2020-10-15 
	 * @param acVo
	 * @return 告警分页查询
	 **/
	@Override
	@Transactional(readOnly=true)
	public Page<AlarmConfig> findPage(AlarmConfigVo acVo) {
		Integer total = acMapper.findTotal(acVo);
		List<AlarmConfig> list = new ArrayList<>();
		if(total > 0) {
			list = acMapper.findList(acVo);
		}
		return new Page<AlarmConfig>(list,acVo,total);
	}

}